import request from '@/utils/request';

// 创建订单
export const createOrderService = (data) => {
    return request.post('/order/createOrder', data, {
        headers: {
            'Content-Type': 'application/json'
        }
    });
}

// 更改订单状态
export const updateOrderService = (status, ordersId) => {
    const params = new URLSearchParams();
    params.append('status', status);
    params.append('ordersId', ordersId);
    return request.post('/order/updateOrder',params);
}

// 获取订单列表
export const getOrderListService = (pageNum) => {
    return request.get('/order/getOrders?pageNum='+pageNum)
}